package com.xunwulian.web.entity;

import com.xunwulian.base.constant.SmsType;
import com.xunwulian.base.entity.SmsPocessorCountByUserEntity;
import com.xunwulian.base.util.EnumUtils;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.commons.beanutils.converters.DateConverter;

public class SmsPocessorCountByUserEntityWrapper extends SmsPocessorCountByUserEntity {

    private String typeStr;

    public SmsPocessorCountByUserEntityWrapper(SmsPocessorCountByUserEntity entity) {
        try {
            ConvertUtils.register(new DateConverter(null), java.util.Date.class);
            BeanUtils.copyProperties(this, entity);
        } catch (Exception e) {
            e.printStackTrace();
        }

        this.typeStr = EnumUtils.getEnumByType(SmsType.class, this.getType()).getDesc();
    }

    public String getTypeStr() {
        return typeStr;
    }

    public void setTypeStr(String typeStr) {
        this.typeStr = typeStr;
    }
}
